const express = require('express');
const router = express.Router();

router.get('/', (req, res) => {
    const content = [];
    for(let i = 0; i < 100; i++)
        content.push({
            id: `2019${i}`,
            code: `2019${i}`,
            name: `大区${i}`,
            branchCode: '20119',
            status: 1,
            rowVersion: 'string',
            options: ['update', 'abandon']
        });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 100,
        }
    });
});

router.put('/forDealer/:id', (req, res) => {
    res.json(
        {
            message: '修改成功'
        }
    );
});

router.get('/forDealer/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: 'string',
                code: 'string',
                name: 'string',
                shortCode: 'string',
                shortName: 'string',
                kind: 20,
                type: 1,
                status: 1,
                areaId: 'string',
                area: 'string',
                email: 'string',
                countryId: 'string',
                country: 'string',
                provinceId: 'string',
                province: 'string',
                cityId: 'string',
                city: 'string',
                contactNumber: 'string',
                fax: 'string',
                address: 'string',
                zipCode: 'string',
                abandonerName: 'string',
                personnelId: 'string',
                abandonTime: '2020-01-13T06:08:42.257Z',
                rowVersion: 'string',
                options: ['update'],
                dealerExtend: {
                    dealerId: 'string',
                    juridicalPerson: 'string',
                    juridicalPersonPhone: 'string',
                    juridicalPersonEmail: 'string',
                    generalManager: 'string',
                    generalManagerPhone: 'string',
                    generalManagerEmail: 'string',
                    salesDirector: 'string',
                    salesDirectorPhone: 'string',
                    salesDirectorEmail: 'string',
                    serviceDirector: 'string',
                    serviceDirectorPhone: 'string',
                    serviceDirectorEmail: 'string',
                    marketDirector: 'string',
                    marketDirectorPhone: 'string',
                    marketDirectorEmail: 'string',
                    financialController: 'string',
                    financialControllerPhone: 'string',
                    financialControllerEmail: 'string',
                    salesInterfacePerson: 'string',
                    salesInterfacePhone: 'string',
                    salesInterfaceEmail: 'string',
                    serviceInterfacePerson: 'string',
                    serviceInterfacePhone: 'string',
                    serviceInterfaceEmail: 'string',
                    incorporatedDate: '2020-01-13T06:08:42.257Z',
                    startTime: '2020-01-13T06:08:42.257Z',
                    authorisedMethod: 1,
                    authorisedArea: 'string',
                    arrivedAddress: 'string',
                    openDate: '2020-01-13T06:08:42.257Z',
                    onlineStatus: 1,
                    updatedDate: '2020-01-13T06:08:42.257Z',
                },
                personnels: [
                    {
                        id: '001',
                        userName: 'userName001',
                        name: 'name001'
                    },
                    {
                        id: '002',
                        userName: 'userName002',
                        name: 'name002'
                    },
                ],
            },
        }
    );
});
module.exports = router;
